<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'update.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style type="text/css">
	td{
		text-align: center;	
	}
	input{
	text-align: center;	
	}
	th{
	background-color: #abcdef;
	}
	</style>
  </head>
  
  <body>
   <center>
    <form action="fruitAction!doUpdate" method="post">
    
    	<table border="1">
    	<c:forEach items="${findById }" var="f">
    	<input type="hidden" name="fruit.fid" value="${f.fid}"/>
			<tr>
				<th>水果名称</th>
				<td>
				<input name="slump.name" value="${f.fname }"/>
				</td>
			</tr>
			<tr>
				<th>水果价格</th>
				<td>
				<input name="fruit.fprice" value="${f.fprice }"/></td>
			</tr>
			<tr>
				<th>产地</th>
				<td>
				<select name="fruit.product.pid">
						<c:forEach items="${list }" var="c">
							<option value="${c.pid }" 
								<c:if test="${f.product eq c.pid }">selected="selected"</c:if>
							>
								${c.name}
							</option>
						 </c:forEach>
				  </select><br>
				</td>
			</tr>
			<tr>
			<td colspan="2"><input type="submit" value="修改"/></td>
			</tr>
			</c:forEach>
		</table>
		</form>
		</center>
  </body>
</html>
